﻿var staffProfileUtil = {
    getStaffProfileByID: function (staffID, callback) {
        $.ajax({
            type: "GET",
            url: staffProfileUrl + "GetStaffProfileByID?staffID=" + staffID,
            contentType: "application/json; charset=utf-8",            
            success: function (result) {
                var resultJSON = $.parseJSON(result.d);
                callback(resultJSON);
            },
            failure: function (msg) {
                alert(msg);
            }
        });
    },
    
    getStaffProfileByName: function (staffName, callback) {
        $.ajax({
            type: "GET",
            url: staffProfileUrl + "GetStaffProfileByName?staffName=" + staffName,
            contentType: "application/json; charset=utf-8",            
            success: function (result) {
                var resultJSON = $.parseJSON(result.d);
                callback(resultJSON);
            },
            failure: function (msg) {
                alert(msg);
            }
        });
    }
}